{% set order = hookable_metadata.context.resource %}

{% if sylius_sm_can(order, constant('Sylius\\Component\\Order\\OrderTransitions::GRAPH'), constant('Sylius\\Component\\Order\\OrderTransitions::TRANSITION_CANCEL')) %}
    <form action="{{ path('sylius_admin_order_cancel', {'id': order.id}) }}" method="POST" novalidate>
        <input type="hidden" name="_method" value="PUT">
        <input type="hidden" name="_csrf_token" value="{{ csrf_token(order.id) }}" />
        <button type="submit" class="dropdown-item" {{ sylius_test_html_attribute('cancel-order') }}>
            {{ ux_icon('tabler:circle-check', {'class': 'icon dropdown-item-icon'}) }}
            {{ 'sylius.ui.cancel'|trans }}
        </button>
    </form>
{% endif %}
